﻿<UserControl x:Class="PatientVisitUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
             xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" Width="810">
    <Grid Background="{StaticResource WindowBackground}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="60"/>
            <ColumnDefinition Width="30"/>
            <ColumnDefinition Width="40"/>
            <ColumnDefinition Width="110"/>
            <ColumnDefinition Width="90"/>
            <ColumnDefinition Width="160"/>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="220"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Visit No:" Style="{StaticResource TextBlockStyle}"/>
        <TextBlock Name="IDTextBlock" Text="1" Grid.Column="1" Style="{StaticResource TextBlockStyle}"/>
        <TextBlock Text="Date:" Grid.Column="2" Style="{StaticResource TextBlockStyle}"/>
        <DatePicker Grid.Column="3" Height="28" Name="VisitDateDatePicker" Width="110" HorizontalAlignment="Left"/>
        <TextBlock Text="Consulting Dr:" Grid.Column="4" Style="{StaticResource TextBlockStyle}"/>
        <ComboBox Grid.Column="5" Width="150" Margin="2" Name="ConsultingDocComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
        <TextBlock Text="Chief Complaint:" Grid.Column="6" Style="{StaticResource TextBlockStyle}"/>
        <ComboBox Grid.Column="7" Width="210" Margin="2" Name="ChiefComplaintsComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
        <TextBlock Text="Problems" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
        <Button Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Left"  Grid.Row="1" IsEnabled="False" Content="Add Problems" Name="AddProblemsButton" Margin="3" Height="25" Width="90"/>
        <my:DataGrid AutoGenerateColumns="False" Margin="5" Height="100" VerticalAlignment="Top" IsReadOnly="True" Grid.Row="2" Name="ProblemsDataGrid" Grid.ColumnSpan="6">
            <my:DataGrid.Columns>
                <my:DataGridTextColumn Header="Reporting Date" Binding="{Binding reportedDateTime}" />
                <my:DataGridTextColumn Header="Problems" Binding="{Binding problemName}" Width="240"/>
                <my:DataGridTextColumn Header="Location" Binding="{Binding problemLocationName}" />
                <my:DataGridTextColumn Header="Severity" Binding="{Binding severityName}" />
            </my:DataGrid.Columns>
        </my:DataGrid>
        <StackPanel Grid.Column="6" Grid.ColumnSpan="2" Grid.Row="1" Orientation="Horizontal">
            <TextBlock Text="Findings" Style="{StaticResource TextBlockStyle}"/>
            <Button HorizontalAlignment="Left" IsEnabled="False" Content="Add Findings" Name="AddFindingsButton" Margin="3" Height="25" Width="110"/>
        </StackPanel>
        <my:DataGrid AutoGenerateColumns="False" Margin="5" Height="100" VerticalAlignment="Top" Grid.Column="6" IsReadOnly="True" Grid.Row="2" Name="FindingsDataGrid" Grid.ColumnSpan="5">
            <my:DataGrid.Columns>
                <my:DataGridTextColumn Header="Finding Type" Binding="{Binding findCategoryName}" Width="110"/>
                <my:DataGridTextColumn Header="Findings" Binding="{Binding findingsName}" Width="200"/>
            </my:DataGrid.Columns>
        </my:DataGrid>
        <TextBlock Text="Diagnosis" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
        <Button Grid.Column="1" Grid.Row="3" HorizontalAlignment="Left" IsEnabled="False" Content="Add Diagnosis" Name="AddDiagnosisButton" Grid.ColumnSpan="3" Margin="3" Height="25" Width="110"/>
        <my:DataGrid AutoGenerateColumns="False" Margin="5" Height="100" VerticalAlignment="Top" IsReadOnly="True" Grid.Row="4" Name="DiagnosisDataGrid" Grid.ColumnSpan="5">
            <my:DataGrid.Columns>
                <my:DataGridTextColumn Header="Diagnosis" Binding="{Binding Name}" Width="140"/>
                <my:DataGridTextColumn Header="Diagnosis Date" Binding="{Binding diagnosisDateTime}" />
                <my:DataGridTextColumn Header="Status" Binding="{Binding status}" />
            </my:DataGrid.Columns>
        </my:DataGrid>
        <StackPanel Grid.Column="5" Grid.ColumnSpan="3" Grid.Row="3" Orientation="Horizontal">
            <TextBlock Text="Treatment" Style="{StaticResource TextBlockStyle}"/>
            <Button HorizontalAlignment="Left" IsEnabled="False" Content="Add Treatment" Name="AddTreatmentButton" Margin="3" Height="25" Width="110"/>
            <Button HorizontalAlignment="Left" IsEnabled="False" Content="Print Prescription" Name="PrintPrescriptionButton" Margin="3" Height="25" Width="110"/>
        </StackPanel>
        <my:DataGrid AutoGenerateColumns="False" Margin="5" Height="100" VerticalAlignment="Top" Grid.Column="5" Grid.Row="4" Name="TreatmentsDataGrid" Grid.ColumnSpan="5">
            <my:DataGrid.Columns>
                <my:DataGridTextColumn Header="Medicine" Width="220" Binding="{Binding medicineItem}" IsReadOnly="True"/>
                <my:DataGridTextColumn Header="Dosage" Binding="{Binding dosage}"/>
                <my:DataGridTextColumn Header="Frequency" Binding="{Binding frequencyName}" IsReadOnly="True"/>
                <my:DataGridTextColumn Header="Duration" Binding="{Binding duaration}" />
                <my:DataGridTextColumn Binding="{Binding periods}" />
            </my:DataGrid.Columns>
        </my:DataGrid>
        <TextBlock Text="Notes:" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
        <extToolkit:WatermarkTextBox Width="740" HorizontalAlignment="Left" Grid.Row="5" Grid.ColumnSpan="7" Grid.Column="1" Watermark="Notes" Name="NotesTextBox" Margin="5,2" VerticalScrollBarVisibility="Auto" AcceptsReturn="True" TextWrapping="WrapWithOverflow" Height="40"/>
        <my:DataGrid AutoGenerateColumns="False" Margin="5" Height="110" VerticalAlignment="Top" IsReadOnly="True" Grid.Row="7" Name="VisitsDataGrid" Grid.ColumnSpan="8">
            <my:DataGrid.Columns>
                <my:DataGridTemplateColumn Header="Visit No">
                    <my:DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding VisitID}" Name="VisitIDTextBlock" Style="{StaticResource HyperLinkTextBlockStyle}" MouseLeftButtonDown="VisitIDTextBlock_MouseLeftButtonDown"/>
                        </DataTemplate>
                    </my:DataGridTemplateColumn.CellTemplate>
                </my:DataGridTemplateColumn>
                <my:DataGridTextColumn Header="Date" Binding="{Binding LastVisit}" Width="100"/>
                <my:DataGridTextColumn Header="Consulting Doc" Binding="{Binding Doctor}" Width="120"/>
                <my:DataGridTextColumn Header="Complaints" Binding="{Binding Complain}" Width="200"/>
                <my:DataGridTextColumn Header="Visit Status" Binding="{Binding VisitStatus}" />
                <my:DataGridTextColumn Header="Visit Note" Binding="{Binding VisitNote}" Width="230"/>
            </my:DataGrid.Columns>
        </my:DataGrid>
    </Grid>
</UserControl>
